<template>
    <div >
        <!-- 调课申请适配 -->
            <div >
              <el-form >
                  <el-row>
                    <el-col :span="8">
                        <el-form-item :label="$t('courseSummary.classChangeType')+':'" >
                            <template >{{getType(content.type)}}</template>
                        </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                      <el-col :span="6">
                        <el-form-item :label="$t('label.college')+':'" >
                            <el-select disabled="true" v-model="content.faculty" >
                                <el-option v-for="item in options.college" :key="item.value" :label="item.label" :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item :label="$t('label.courseCode')+':'" >
                          <template >{{ content.courseCode }}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item :label="$t('label.courseName')+':'" >
                          <template >{{content.courseName }}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item :label="$t('courseSummary.studentAgree')+':'" >
                          <template >{{transBoolean(content.studentAgree)}}</template>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row>
                      <el-col >
                        <el-form-item :label="$t('courseSummary.applyReason')+':'" >
                          <div style="width=100%;word-break:break-all;">{{content.reson}}</div>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row v-if="content.type==1">
                      <el-col :span="6">
                        <el-form-item label="原上课时间：" >
                          <template >{{content.oldTimeStr}}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="原上课地点: " >
                          <template >{{content.oldAddress}}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="原授课老师: " >
                          <template >{{content.oldTeacherName}}</template>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row v-if="content.type==1">
                      <el-col :span="6">
                        <el-form-item label="新上课时间：" >
                          <template >{{content.newTimeStr}}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="新上课地点: " >
                          <template >{{content.newAddress}}</template>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6">
                        <el-form-item label="新授课老师: " >
                          <template >{{content.newTeacherName}}</template>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row v-if="content.type==2">
                      <el-col :span="12" >
                          <el-form-item label="原上课信息：" >
                              <el-input :disabled="true" type="textarea" rows="5" v-model="content.oldInfo" ></el-input>
                          </el-form-item>
                      </el-col>
                      <el-col :span="12" >
                          <el-form-item label="新上课信息：" >
                              <el-input :disabled="true" type="textarea" rows="5" v-model="content.newInfo" ></el-input>
                          </el-form-item>
                      </el-col>
                  </el-row>
              </el-form>
          </div>
    </div>

</template>

<script>
import UTILS from "common/src/utils/utils";
import { queryDic } from "common/src/api/dictionary";
export default {
  props: {
    content: {
      default: null
    }
  },
  methods:{
    getType(type){
          if(type==1){
            return this.$t('courseSummary.shortTermAdjustment');
          }else{
            return this.$t('courseSummary.longTermAdjustment')
          }
    },
    transBoolean(type){
      if(type==1){
        return this.$t('message.yes');
      }else{
        return this.$t('message.no');
      }
    },
    getOptions() {
      //筛选条件字典查询
      let data = {
          lang: this.$store.getters.language || "cn",
          type: "allChild",
          keys: [
              "X_YX",
          ]
      };
      queryDic(data).then(res => {
          if (res.code == 200) {
              UTILS.fillSelect(
                  {
                      college: "X_YX",
                  },
                  res.data,
                  this.options
              );
              // searchList未定义注销掉
            //   this.searchList();
              this.isEnable = true;
          }
      });
    },
  },
  data(){
    return {
      options:{
               college: []
            }
    }
  },
  mounted() {
      this.getOptions();
    },
}
</script>
